tests/test-admin-deploy-none: Split grub.cfg directory and file creation
authorRobert Fairley <rfairley@redhat.com>
Wed, 3 Apr 2019 16:25:04 +0000 (12:25 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 24 Apr 2019 21:29:39 +0000 (21:29 +0000)
Split the creation of the directory containing grub.cfg, and the creation
of the file, so that a failure in the mkdir command will fail the test
and not attempt the touch command.

Closes: #1831
Approved by: jlebon

tests/test-admin-deploy-none.sh

index d798e60e0635ecf2722e044ee1e67171cfa9d8d1..66a1491fc7c87b4c4ed462f093c658677d5ef018 100755 (executable)
@@ -37,7 +37,8 @@ setup_os_repository "archive" "sysroot.bootloader none"
 ${CMD_PREFIX} ostree pull-local --repo=sysroot/ostree/repo --remote testos testos-repo testos/buildmaster/x86_64-runtime
 # Test that configuring sysroot.bootloader="none" is a workaround for previous
 # grub2 bootloader issue (see https://github.com/ostreedev/ostree/issues/1774)
-mkdir -p sysroot/boot/grub2 && touch sysroot/boot/grub2/grub.cfg
+mkdir -p sysroot/boot/grub2
+touch sysroot/boot/grub2/grub.cfg
 ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os testos testos/buildmaster/x86_64-runtime > out.txt
 assert_file_has_content out.txt "Bootloader updated.*"
 assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'options.* root=LABEL=MOO'